
{extend name='public/window' /}

{block name="content"}
<style>
    .layui-upload-drag {
        position: relative;
        padding: 10px;
        border: 1px dashed #e2e2e2;
        background-color: #fff;
        text-align: center;
        cursor: pointer;
        color: #999;
        border-radius: 50%;
    }
    .layui-form-label{
        width: 110px;
    }
    .layui-input-block{
        width: 85%;
        margin-left: 146px;
    }
    .layui-input, .layui-textarea {
        display: block;
        width: 80%;
        padding-left: 10px;
    }
    /* .layui-form-select {
        position: absolute;
        right: 165px;
        top: 50%;
        } */
    .layui-form-select .layui-edge {
        position: absolute;
        right: 170px !important;
        top: 50%;
    }
    .layui-form-select dl {
        min-width: 80% !important;
    }
    .layui-form-label {
        width: 116px !important;
    }
</style>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body" style="padding: 15px;">
            <form class="layui-form" action="" lay-filter="form">
                {if isset($info.id)}
                <input type="hidden" name="id" value="{$info.id}">
                {/if}
                <input type="hidden" name="id" id="id" value="{$list.id}"/>
                <div class="layui-form-item nolins">
                    <label class="layui-form-label">商户名 </label>
                    <div class="layui-input-block">
                        <input type="text"   autocomplete="off"
                               placeholder="请输入公司名称"  disabled class="layui-input" value="{$list.company}">
                    </div>
                </div>
                <div class="layui-form-item nolins">
                    <label class="layui-form-label">发票抬头 </label>
                    <div class="layui-input-block">
                        <input type="text"  disabled autocomplete="off"
                               class="layui-input" id="title" value="{$list.title}">
                    </div>
                </div>
                <div class="layui-form-item nolins">
                    <label class="layui-form-label">购买方开户行账号 </label>
                    <div class="layui-input-block">
                        <input type="text"  disabled  autocomplete="off"
                               placeholder="" class="layui-input" value="{$list.bankAccount}">
                    </div>
                </div>
                <div class="layui-form-item nolins">
                    <label class="layui-form-label">购买方开户行名称 </label>
                    <div class="layui-input-block">
                        <input type="text"  disabled autocomplete="off"
                               placeholder="" class="layui-input" value="{$list.bankName}">
                    </div>
                </div>
                <div class="layui-form-item nolins">
                    <label class="layui-form-label">购买方地址 </label>
                    <div class="layui-input-block">
                        <input type="text"  disabled autocomplete="off"
                               placeholder="" class="layui-input" value="{$list.companyAddress}">
                    </div>
                </div>
                <div class="layui-form-item nolins">
                    <label class="layui-form-label">纳税人识别号 </label>
                    <div class="layui-input-block">
                        <input type="text"  disabled autocomplete="off"
                               placeholder="" class="layui-input" value="{$list.taxNumber}">
                    </div>
                </div>
                <div class="layui-form-item nolins">
                    <label class="layui-form-label">购买方电话 </label>
                    <div class="layui-input-block">
                        <input type="text"  disabled autocomplete="off"
                               placeholder="" class="layui-input" value="{$list.telephone}">
                    </div>
                </div>
                <div class="layui-form-item nolins">
                    <label class="layui-form-label">发送邮箱 </label>
                    <div class="layui-input-block">
                        <input type="text"  disabled autocomplete="off"
                               placeholder="" class="layui-input" value="{$list.email}">
                    </div>
                </div>
                <div class="layui-form-item nolins">
                    <label class="layui-form-label">合计总金额 </label>
                    <div class="layui-input-block">
                        <input type="text"  disabled autocomplete="off"
                               placeholder="" class="layui-input" value="{$list.amount/100}">
                    </div>
                </div>
                <table class="layui-table">
                    <thead>
                    <tr>
                        <td>费用项</td>
                        <td>金额</td>
                        <td>费用区间</td>
                    </tr>
                    </thead>
                    <tbody class="role_list">
                    {foreach $list['costInfo'] as $key=>$id}
                    <tr>
                        <td>{$id.costType.cost_name}</td>
                        <td>{$id.all_amount/100}</td>
                        <td>{$id.start_time}~{$id.end_time}</td>
                    </tr>
                    {/foreach}
                    </tbody>

                </table>
                {if condition="$list['invoice_type'] eq 2&&$list['status']==0"}
                <div class="layui-form-item layui-layout-admin " style="width: 100%">
                    <div class="layui-input-block">
                        <div class="layui-footer" style="left: 0px;text-align: center;">
                            <button class="layui-btn layui-bg-red" lay-submit="" lay-filter="refuse">驳回</button>
                            <button id="tijiao"   class="layui-btn " lay-submit="" lay-filter="ticket">已开专票</button>
                        </div>
                    </div>
                </div>

                {/if}
                {if condition="$list['status'] eq 1"}
<!--                <div class="layui-form-item layui-layout-admin " style="width: 100%">-->
<!--                    <div class="layui-input-block">-->
<!--                        <div class="layui-footer" style="left: 0px;text-align: center;">-->
<!--                            <button class="layui-btn" lay-submit="" lay-filter="blush">冲红发票</button>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                </div>-->
                {/if}
                {if condition="$list['status'] eq 3"}
<!--                <div class="layui-form-item layui-layout-admin " style="width: 100%">-->
<!--                    <div class="layui-input-block">-->
<!--                        <div class="layui-footer" style="left: 0px;text-align: center;">-->
<!--                            <div class="layui-btn layui-bg-red">已冲红</div>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                </div>-->
                {/if}
            </form>
        </div>
    </div>
</div>


<script>
    layui.use(['element', 'form', 'jquery','lucky','upload','laydate','xmSelect'], function () {
        var element = layui.element;
        var table = layui.table;
        var form = layui.form;
        var laydate = layui.laydate;
        var $ = layui.jquery;
        var lucky=layui.lucky;
        laydate.render({
            elem: '#start_time'
            ,type: 'date',
            trigger: 'click'
        });
        laydate.render({
            elem: '#end_time'
            ,type: 'date',
            trigger: 'click'
        });
        form.on('submit(refuse)', function (data) {
            lucky.FormSubmit("{:url('refuse')}",data.field,true);
            return false;
        });
        form.on('submit(ticket)', function (data) {
            lucky.FormSubmit("{:url('ticket')}",data.field,true);
            return false;
        });

        form.on('submit(blush)', function (data) {
            lucky.FormSubmit("{:url('blush')}",data.field,true);
            return false;
        });
    })
</script>

{/block}

